/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ereconquista.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "fotos_empresas", catalog = "ereconquista", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FotoEmpresa.findAll", query = "SELECT f FROM FotoEmpresa f"),
    @NamedQuery(name = "FotoEmpresa.findById", query = "SELECT f FROM FotoEmpresa f WHERE f.id = :id"),
    @NamedQuery(name = "FotoEmpresa.findByFoto", query = "SELECT f FROM FotoEmpresa f WHERE f.foto = :foto"),
    @NamedQuery(name = "FotoEmpresa.findByDescrip", query = "SELECT f FROM FotoEmpresa f WHERE f.descrip = :descrip"),
    @NamedQuery(name = "FotoEmpresa.findByFecha", query = "SELECT f FROM FotoEmpresa f WHERE f.fecha = :fecha"),
    @NamedQuery(name = "FotoEmpresa.findByFkEmpresa", query = "SELECT f FROM FotoEmpresa f WHERE f.fkEmpresa = :fkEmpresa"),
    @NamedQuery(name = "FotoEmpresa.findByPrincipal", query = "SELECT f FROM FotoEmpresa f WHERE f.principal = :principal"),
    @NamedQuery(name = "FotoEmpresa.findByOrden", query = "SELECT f FROM FotoEmpresa f WHERE f.orden = :orden")})
public class FotoEmpresa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Long id;
    @Basic(optional = false)
    @Column(nullable = false, length = 255)
    private String foto;
    @Column(length = 255)
    private String descrip;
    @Basic(optional = false)
    @Column(nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Basic(optional = false)
    @Column(name = "fk_empresa", nullable = false)
    private long fkEmpresa;
    @Basic(optional = false)
    @Column(nullable = false)
    private int principal;
    @Basic(optional = false)
    @Column(nullable = false)
    private int orden;

    public FotoEmpresa() {
    }

    public FotoEmpresa(Long id) {
        this.id = id;
    }

    public FotoEmpresa(Long id, String foto, Date fecha, long fkEmpresa, int principal, int orden) {
        this.id = id;
        this.foto = foto;
        this.fecha = fecha;
        this.fkEmpresa = fkEmpresa;
        this.principal = principal;
        this.orden = orden;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFoto() {
        return foto;
    }

    public void setFoto(String foto) {
        this.foto = foto;
    }

    public String getDescrip() {
        return descrip;
    }

    public void setDescrip(String descrip) {
        this.descrip = descrip;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public long getFkEmpresa() {
        return fkEmpresa;
    }

    public void setFkEmpresa(long fkEmpresa) {
        this.fkEmpresa = fkEmpresa;
    }

    public int getPrincipal() {
        return principal;
    }

    public void setPrincipal(int principal) {
        this.principal = principal;
    }

    public int getOrden() {
        return orden;
    }

    public void setOrden(int orden) {
        this.orden = orden;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FotoEmpresa)) {
            return false;
        }
        FotoEmpresa other = (FotoEmpresa) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ereconquista.modelo.FotoEmpresa[ id=" + id + " ]";
    }
    
}
